<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>组件注册</title>
    <script src="./lib/vue.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="app">
    <button-counter></button-counter>
    <test></test>
</div>
<script type="text/javascript">
    // 全局注册 start
    Vue.component('button-counter', {
        props: ['title'],
        data: function () {
            return {}
        },
        template: '<div><h1>hi...</h1></div>',
        methods:{

        }
    })
    // 全局注册 end
    var vm = new Vue({
        el : "#app",
        data : {

        },
        methods:{
            clicknow : function (e) {
                console.log(e);
            }
        },
        // 局部注册 start
        components:{
            test : {
                template:"<h2>h2...</h2>"
            }
        }
        // 局部注册 end
    });
</script>
<style type="text/css">

</style>
</body>
</html>
